<template>
  <div>
    <Header></Header>
    <router-view></router-view> <!--各类路由组件展示区域-->
    <Footer v-show="$route.meta.show"></Footer>
  </div>
</template>

<script>
// 引入
import Header from './components/Header';
import Footer from './components/Footer';

export default {
  name: 'App',
  components: {
    Header,
    Footer
  },

  methods:{
    importCanvesJs(){  //引入外部js
       let script1 = document.createElement('script');  //创建script标签
       let script2 = document.createElement('script');
       let head = document.getElementsByTagName('head')[0];  //获取head标签
       script1.src = '<%= BASE_URL %>js/swiper.min.js';
       script1.src = '<%= BASE_URL %>js/swiper.js';
       head.appendChild(script1);
       head.appendChild(script2);
    }
  },

  mounted(){
    // this.importCanvesJs();
    this.$store.dispatch("home/getCategoryList");//保证只派发一次
  }
}

</script>

<style lang="css">
body{
  overflow: hidden;
  padding-right: 0 !important;
}

#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}

#nprogress .bar{
  /* 更改进度条颜色 */
  background: #E1251B !important;/** 设置最高权重*/
}

.el-button--primary{
  background-color: #E1251B !important;
  color: #FFF;
  border-color: #E1251B !important;
}


</style>
